﻿using System;

using Kenly.DBFramework.Reflection;

namespace Kenly.DBFramework.Gateway
{
    internal interface ITableGatewayUtility<T>
     where T : TableGateway<T>, new()
    {

        int AddNew(ITableCommandExecutor tableCommandExecutor, ICommandReflector commandReflector,
            T entity, bool returnIdentity);


        #region MyRegion

        int AddNew(System.Collections.Generic.IList<T> entities, out Kenly.DBFramework.Gateway.Transaction transaction);
        int AddNew(System.Collections.Generic.IList<T> entities);
        int AddNew(System.Collections.Generic.IList<T> entities, bool returnIdentity, out Kenly.DBFramework.Gateway.Transaction transaction);
        int AddNew(System.Collections.Generic.IList<T> entities, bool returnIdentity);
        int AddNew(T entity, out Kenly.DBFramework.Gateway.Transaction transaction);
        int AddNew(T entity);
        int AddNew(T entity, bool returnIdentity, out Kenly.DBFramework.Gateway.Transaction transaction);
        int AddNew(T entity, bool returnIdentity);
        int Delete(string condition);
        int Delete(string condition, out Transaction transaction);
        int DeleteById(System.Collections.Generic.IList<T> entities);
        int DeleteById(T entity);
        int DeleteById(T entity, out Kenly.DBFramework.Gateway.Transaction transaction);
        int DeleteById(System.Collections.Generic.IList<T> entities, out Kenly.DBFramework.Gateway.Transaction transaction);
        int DeleteByPK(T entity, out Kenly.DBFramework.Gateway.Transaction transaction);
        int DeleteByPK(System.Collections.Generic.IList<T> entities);
        int DeleteByPK(T entity);
        int DeleteByPK(System.Collections.Generic.IList<T> entities, out Kenly.DBFramework.Gateway.Transaction transaction);
        int Update(T entity, string condition);
        int Update(T entity, string condition, out Kenly.DBFramework.Gateway.Transaction transaction);
        int UpdateById(T entity);
        int UpdateById(T entity, out Kenly.DBFramework.Gateway.Transaction transaction);
        int UpdateById(System.Collections.Generic.IList<T> entities);
        int UpdateById(System.Collections.Generic.IList<T> entities, out Kenly.DBFramework.Gateway.Transaction transaction);
        int UpdateByPK(T entity, out Kenly.DBFramework.Gateway.Transaction transaction);
        int UpdateByPK(T entity);
        int UpdateByPK(System.Collections.Generic.IList<T> entities);
        int UpdateByPK(System.Collections.Generic.IList<T> entities, out Kenly.DBFramework.Gateway.Transaction transaction); 

        #endregion
    }
}
